//
//  CCNetworkImageView.m
//  TYEJ
//
//  Created by CC on 2019/12/1.
//  Copyright © 2019 CC. All rights reserved.
//

#import "CCNetworkImageView.h"
#import "LcFoundation.h"

@implementation CCNetworkImageView

- (void)setImageWithURL:(NSString*)url {
  [self setImageWithURL:url placeholderImage:nil];
}

- (void)setImageWithURL:(NSString*)url placeholderImage:(UIImage*)placeholder {
  [self setImageWithURL:url
       placeholderImage:placeholder
                options:SDWebImageAllowInvalidSSLCertificates
              completed:nil];
}

- (void)setImageWithURL:(NSString*)url
       placeholderImage:(UIImage*)placeholder
                options:(SDWebImageOptions)options
              completed:(SDExternalCompletionBlock)completedBlock {
  [self sd_setImageWithURL:[NSURL URLWithString:url]
          placeholderImage:placeholder != nil ? placeholder
                                              : [UIImage imageNamed:@"noimg"]
                   options:options
                 completed:completedBlock];
}

- (void)prepareForCancleLoad {
  [self sd_cancelCurrentImageLoad];
}

@end
